package com.lihui.merge;

import java.util.Arrays;

/**
 * 功能描述
 *
 * @author wileda
 * @date 2022/09/29  15:12
 */
public class Main {
    public static void main(String[] args) {
        int[] nums1 = {1,2,3,0,0,0};
        int[] nums2 = {2,5,6};
        Solution solution = new Solution();
        solution.merge(nums1,3,nums2,3);
    }
}
class Solution {
    public void merge(int[] nums1, int m, int[] nums2, int n) {
        if (nums1.length == 0){
            System.out.println(nums2);
        }
        if (nums2.length == 0){
            System.out.println(nums1);
        }
        for (int i = m; i < nums1.length ; i++) {
                nums1[i] = nums2[--n];

        }
        Arrays.sort(nums1);
    }
}